#pragma once
#include "GL/glew.h"
#include "GL/freeglut.h"
#include "glm/mat4x4.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/type_ptr.hpp"
class DOpenGLPointCloud
{
private:
	bool isInited;
	GLuint vao;
	GLuint vbo_vertex;
	GLuint vbo_norm;
	GLuint vbo_color;
	int pointNum;
	glm::mat4 modelMatrix;
public:
	bool Init();
	bool IsInited() const;
	void CleanUp();
	bool LoadPointCloud(const GLfloat* data, int float_per_point, int pointNum, GLenum usage);
	bool LoadPointCloudNorm(const GLfloat* data, int float_per_point, int pointNum_, GLenum usage);
	bool LoadPointCloudColor(const GLfloat* data, int float_per_point, int pointNum_, GLenum usage);
	void ResetModelMatrix();
	void SetModelMatrix(const float pose_R[9], const float pose_T[3]);
	const float*  GetModelMatrixPtr() const;
	bool DrawPointCloud(GLint first, int count, int render_modelMatrix_position) const;
	bool DrawPointCloud(int render_modelMatrix_position) const;
	GLuint GetVAOHandle() const;
	GLuint GetVBOHandle() const;
public:
	DOpenGLPointCloud(void);
	~DOpenGLPointCloud(void);
};

